package com.mpush.api.biz;

import java.io.Serializable;
import java.util.Arrays;

/**
 * 
 * @author chenliyu
 *
 */
public class UpStreamMessage implements Serializable {
  private Integer cmd;
  
  private String token;
  
  private String sn;
  
  private String order;
  
  private String jsonContent;
  
  private Long timestamp;
  
  private byte[] pic;
  
  public Integer getCmd() {
    return this.cmd;
  }
  
  public void setCmd(Integer cmd) {
    this.cmd = cmd;
  }
  
  public String getSn() {
    return this.sn;
  }
  
  public void setSn(String sn) {
    this.sn = sn;
  }
  
  public String getOrder() {
    return this.order;
  }
  
  public void setOrder(String order) {
    this.order = order;
  }
  
  public byte[] getPic() {
    return this.pic;
  }
  
  public void setPic(byte[] pic) {
    this.pic = pic;
  }
  
  public Long getTimestamp() {
    return this.timestamp;
  }
  
  public void setTimestamp(Long timestamp) {
    this.timestamp = timestamp;
  }
  
  public String getToken() {
    return this.token;
  }
  
  public void setToken(String token) {
    this.token = token;
  }
  
  public String getJsonContent() {
    return this.jsonContent;
  }
  
  public void setJsonContent(String jsonContent) {
    this.jsonContent = jsonContent;
  }
  
  public int getPicLen() {
    if (this.pic != null)
      return this.pic.length; 
    return 0;
  }
  
  public String toString() {
    return "UpStreamMessage{cmd=" + this.cmd + ", token='" + this.token + '\'' + ", sn='" + this.sn + '\'' + ", order='" + this.order + '\'' + ", jsonContent='" + this.jsonContent + '\'' + ", timestamp=" + this.timestamp + ", pic=" + 
      
      Arrays.toString(this.pic) + '}';
  }
}
